<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/js/axios.min.js"></script>
    <script src="/js/util.js"></script>
    <script>
        function login() {
            axios.get("/user/login", {
                params: {
                    name: $("name").value,
                    pwd: $("pwd").value
                }
            }).then(resp => {
                var info = resp.data;
                if (info == "ok") {
                    location.href = "/index.html"
                } else {
                    $("loginSpan").innerHTML = "登陆失败";
                }
            })
        }
    </script>
</head>
<body>
<a href="/register.html">注册</a><br>
<span>登陆</span><br>
用户名：<input type="text" id="name"><br>
用户密码:<input type="password" id="pwd"><br>
<input type="button" value="登陆" onclick="login()"><br>
<span id="loginSpan"></span>
</body>
</html>